<?php
$host = "localhost";
$user = "root";
$pass = "";
$db ="eeg";
$koneksi = mysql_connect($host, $user, $pass);
if (!$koneksi) {
echo "Koneksi ke server tidak berhasil";
};
$database = mysql_select_db($db);
if (!$database) {
echo "Koneksi ke database tidak berhasil";
}
mysql_select_db($db) or die ("Database not Found !");
$sesi='ebihari10';
$sql = "SELECT SUM('Selisih waktu') FROM selisihwaktu where sesi=$sesi"; 
$rs_resul = mysql_query ($sql); 



$sql = "SELECT * FROM selisihwaktu where sesi='ebihari10'"; 
$rs_result = mysql_query ($sql); 

while( $rows = mysql_fetch_row($rs_result) ){
				$menu = $rows[1];
			 $men1 = $rows[2];
				
				
			
			
			for ($i=0; $i<=$menu; $i++) {
			echo $men1;
			
$sqlqq = "INSERT INTO hasilselish
VALUES (' ','$men1','$sesi')"; 
$rs_resultqq = mysql_query ($sqlqq); 
		}
			
			
			}

			
    
    ?>
	